<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>班委管理</title>
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
    <link rel="stylesheet" type="text/css" href="<%=path %>/css/f/default.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/navs.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/assignment.css"/>
	<script src="js/jquery.min.js"></script>
	<script src="js/f/default.js"></script>
	<script type="text/javascript">
	$(document).ready(function(){
		$(".gougou").click(function(){
			var stuId = $(this).attr("href");
			var roleId = $("#role_select option:selected").val();
			$(this).attr("href","counselor/giveStuZ.do?stuId="+stuId+"&roleId="+roleId);
		});
	});
	</script>
</head>
  
  <body>
	<div class="all">
		<jsp:include page="/nav.jsp"></jsp:include>
        <div class="rightall float-left">
        	<div class="already">
				<div class="already-title">
					<div class="left">查看班委</div>
				</div>
				<div style="margin-top:20px;">
					<form method="post" action="counselor/queryAssignmentInfo.do?pageNoTop=1">
                		<span style=" margin-left:20%;"></span>
					班级选择：
						<select name="className" class="task">
							<c:forEach  var="cf" items="${cInfo}">
								<c:if test="${className==cf.className }">
									<option value="${cf.className }"  selected = "selected" >${cf.className }</option>
								</c:if>
								<c:if test="${className!=cf.className }">
									<option value="${cf.className }">${cf.className }</option>
								</c:if>
								
							</c:forEach>
						</select>
                		<span style=" margin-left:10%;"></span>
						<button type="submit" class="btn-style task">查看</button>
					</form>
				</div>
				<div style="margin-top:20px;">
					<table>
						<tr class="tr-style-head">
							<td>学号</td>	
							<td>姓名</td>
							<td>性别</td>
							<td>任职</td>
							<td>联系电话</td>
							<td>操作</td>
						</tr>
						<c:forEach  var="stu" items="${stu}">
							<c:if test="${stu.roleName!='学生' }">
								<tr class="tr-style">
									<td>${stu.stuNo }</td>	
									<td>${stu.stuName }</td>
									<td>${stu.stuSex }</td>
									<td>${stu.roleName }</td>
									<td>${stu.stuPhone }</td>
									<td><a href="counselor/delStuZ.do?stuId=${stu.stuId }" style="color:red">撤销</a></td>
								</tr>
							</c:if>
						</c:forEach>
					</table>
				<c:if test="${pageCountTop > 1 }">
               		<div class="previous">
	               		<c:if test="${pageNoTop>1}">
	                    	<a id="runoob" href="counselor/queryAssignmentInfo.do?pageNoTop=${pageNoTop-1}&pageNo=${pageNo}">上一页</a>
	                	</c:if>
	                   	<c:forEach var="p" begin="1" end="${pageCountTop }" step="1">
	                   		<c:if test="${p==pageNoTop }">
	                   			<span style="font-size:18px;color:#446ee6;">&nbsp;${p}&nbsp;</span>
	                   		</c:if>
	                   		<c:if test="${p!=pageNoTop }">
	                   			<a href="counselor/queryAssignmentInfo.do?pageNoTop=${p}&pageNo=${pageNo}">&nbsp;${p}&nbsp;</a>
	                   		</c:if>
	                   	</c:forEach>
	                    <c:if test="${pageNoTop<pageCountTop}">
	                    	<a id="runaab" href="counselor/queryAssignmentInfo.do?pageNoTop=${pageNoTop+1}&pageNo=${pageNo}"">下一页</a>
	                	</c:if>
                   	</div>
                </c:if>
				</div>
        	</div>
			<div class="already">
				<div class="already-title">
					<div class="left">修改班委</div>
				</div>
				<div style="margin-top:20px;">
					<form method="post" action="counselor/queryAssignmentInfo.do?pageNoTop=1">
					班级选择：
						<select name="className" class="task">
							<c:forEach  var="cf" items="${cInfo}">
								<c:if test="${className==cf.className }">
									<option value="${cf.className }"  selected = "selected" >${cf.className }</option>
								</c:if>
								<c:if test="${className!=cf.className }">
									<option value="${cf.className }">${cf.className }</option>
								</c:if>
							</c:forEach>
						</select>
                		<span style=" margin-left:5%;"></span>
					学生姓名：
						<input type="text" name="findStuName" class="task"/>
                		<span style=" margin-left:5%;"></span>
						<button type="submit" class="btn-style task">查看</button>
                		<span style=" margin-left:5%;"></span>
					职位选择：
						<select class="task" id="role_select">
							<c:forEach  var="role" items="${role}">
								<c:if test="${role.roleId==5 }">
									<option value="${role.roleId }">${role.roleName }</option>
								</c:if>
								<c:if test="${role.roleId==6}">
									<option value="${role.roleId }">${role.roleName }</option>
								</c:if>
								<c:if test="${role.roleId==7}">
									<option value="${role.roleId }">${role.roleName }</option>
								</c:if>
								<c:if test="${role.roleId==8}">
									<option value="${role.roleId }">${role.roleName }</option>
								</c:if>
								<c:if test="${role.roleId==9}">
									<option value="${role.roleId }">${role.roleName }</option>
								</c:if>
								<c:if test="${role.roleId==10}">
									<option value="${role.roleId }">${role.roleName }</option>
								</c:if>
							</c:forEach>
						</select>
                		<span style=" margin-left:3%;"></span>
					<div style="margin-top:20px;">
					<table>
						<tr class="tr-style-head">
							<td>学号</td>	
							<td>姓名</td>
							<td>性别</td>
							<td>联系电话</td>
							<td>操作</td>
						</tr>
						<c:forEach  var="stu" items="${stuAll}">
								<tr class="tr-style">
									<td>${stu.stuNo }</td>	
									<td>${stu.stuName }</td>
									<td>${stu.stuSex }</td>
									<td>${stu.stuPhone }</td>
									<td><a class="gougou" href="${stu.stuId }" style="color:blue">√</a></td>
								</tr>
						</c:forEach>
					</table> 
				<c:if test="${pages > 1 }">
               		<div class="previous">
	               		<c:if test="${pageNo>1}">
	                    	<a id="runoob" href="counselor/queryAssignmentInfo.do?pageNoTop=${pageNoTop}&pageNo=${pageNo-1}">上一页</a>
	                	</c:if>
	                   	<c:forEach var="p" begin="1" end="${pages }" step="1">
	                   		<c:if test="${p==pageNo }">
	                   			<span style="font-size:18px;color:#446ee6;">&nbsp;${p}&nbsp;</span>
	                   		</c:if>
	                   		<c:if test="${p!=pageNo }">
	                   			<a href="counselor/queryAssignmentInfo.do?pageNoTop=${pageNoTop}&pageNo=${p}">&nbsp;${p}&nbsp;</a>
	                   		</c:if>
	                   	</c:forEach>
	                    <c:if test="${pageNo<pages}">
	                    	<a id="runaab" href="counselor/queryAssignmentInfo.do?pageNoTop=${pageNoTop}&pageNo=${pageNo+1}"">下一页</a>
	                	</c:if>
                   	</div>
                </c:if>
				</form>
				</div>
			</div>
		</div>
	</div>
  </body>
</html>
	